#ifndef REAL_FS_OPERATIONS_H_
#define REAL_FS_OPERATIONS_H_

#include <unistd.h>

// Wraps POSIX operations, doing some basic error recovery.  In particular,
// calls should do not need to worry about EINTR.
//
// If these calls return a failure, it should be reasonable to assume that no
// normal error recovery path can be taken to make them succeed.
ssize_t real_read(int fd, char* buf, ssize_t size);
ssize_t real_write(int fd, const char* buf, ssize_t size);

// Unlike normal open() and creat(), whenever we do a file write, we must open
// read/write so we may re-read the checksum.
int real_open(const char* path, int flags);
int real_creat(const char* path, int flags, mode_t mode);

#endif  // REAL_FS_OPERATIONS_H_
